package com.authine.cloudpivot.ext.controller;

import com.authine.cloudpivot.web.api.controller.runtime.WorkflowInstenceRuntimeController;
import com.authine.cloudpivot.web.api.handler.CustomizedOrigin;
import com.authine.cloudpivot.web.api.view.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@Api(description = "方正阀门流程运行接口", tags = "fz::流程实例接口")
@RestController
@RequestMapping("/fz/runtime/workflow")
@Slf4j
@CustomizedOrigin(level = 0)
public class WorkFlowInstanceExtController extends WorkflowInstenceRuntimeController {


    @ApiOperation(value = "撤回任务")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "workflowInstanceId", value = "流程实例id", required = true, dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "activityCode", value = "节点编码", required = true, dataType = "String", paramType = "query")})
    @GetMapping("/revoke_workitem")
    public ResponseResult<Boolean> revokeWorkItem(String workflowInstanceId, String activityCode) {
        return this.handleRevokeWorkItem(workflowInstanceId, activityCode, null);
    }
}
